﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace DataModels.Common
{
    #region Enumerations
    #region Message Template

    /// <summary>
    /// Basic information about the setting of Automatic SMS Reminder
    /// </summary>
    [Flags]
    public enum AutoReminderConfiguration
    {
        /// <summary>
        /// AutoReminder: Default Flag
        /// All flags are turned off in this setting
        /// </summary>
        DEFAULT = 0,                                            // bits: 0000 0000 0000 0000

        /// <summary>
        /// Message Template: Use this template to all reports
        /// </summary>
        MESSAGE_TEMPLATE_SAME_ALL_REPORTS = 1,                  // bits: 0000 0000 0000 0001

        /// <summary>
        /// Message Template: Set message template for each report
        /// </summary>
        MESSAGE_TEMPLATE_EACH_REPORT_HAS_ITS_TEMPLATE = 2,      // bits: 0000 0000 0000 0010

        /// <summary>
        /// Receiver of Reminders: All registered users in the facility
        /// </summary>
        REMINDER_RECEIVERS_ALL_REGISTERED = 4,                  // bits: 0000 0000 0000 0100

        /// <summary>
        /// Receiver of Reminders: All selected users of the facilities
        /// </summary>
        REMINDER_RECEIVERS_SELECTED_USERS = 8,                  // bits: 0000 0000 0000 1000

        /// <summary>
        /// Receiver of Reminders: Send to the last person who sent the last report
        /// </summary>
        REMINDER_RECEIVERS_LAST_REPORT_SENDER = 16,             // bits: 0000 0000 0001 0000

        /// <summary>
        /// Reminding Facilities: By Facilities
        /// </summary>
        REMINDED_FACILITIES_BY_FACILITIES = 32,                 // bits: 0000 0000 0010 0000

        /// <summary>
        /// Reminding Facilities: By Districts
        /// </summary>
        REMINDED_FACILITIES_BY_DISTRICTS = 64,                  // bits: 0000 0000 0100 0000

        /// <summary>
        /// Reminding Facilities: By Regions
        /// </summary>
        REMINDED_FACILITIES_BY_REGIONS = 128,                   // bits: 0000 0000 1000 0000

        /// <summary>
        /// Trigger and Repetition: Weekly Repetition
        /// </summary>
        REPETITION_PATTERN_WEEKLY = 256,                        // bits: 0000 0001 0000 0000

        /// <summary>
        /// Trigger and Repetition: Monthly Repetition
        /// </summary>
        REPETITION_PATTERN_MONTHLY = 512,                       // bits: 0000 0010 0000 0000

        /// <summary>
        /// Stopping Condition: Untill the report is received
        /// </summary>
        STOPPING_CONDITION_UNTIL_REPORT_RECEIVED = 1024,        // bits: 0000 0100 0000 0000

        /// <summary>
        /// Stopping Condition: Two attempts of reminder without any response
        /// </summary>
        STOPPING_CONDITION_AFTER_TWO_ATTEMPTS = 2048,           // bits: 0000 1000 0000 0000

        /// <summary>
        /// Stopping Condition: Until the end of the month
        /// </summary>
        STOPPING_CONDITION_UNTILL_END_OF_MONTH = 4096,          // bits: 0001 0000 0000 0000

        /// <summary>
        /// Sending Exception: Exclude week-ends
        /// </summary>
        SENDING_EXCEPTION_EXCLUDE_WEEK_ENDS = 8192,             // bits: 0010 0000 0000 0000

        /// <summary>
        /// Sending Exception: Exclude holidays
        /// </summary>
        SENDING_EXCEPTION_EXCLUDE_HOLIDAYS = 16384,             // bits: 0100 0000 0000 0000

        /// <summary>
        /// Sending Exception: Use working hours
        /// </summary>
        SENDING_EXCEPTION_USE_WORKING_HOURS = 32768,            // bits: 1000 0000 0000 0000

        /// <summary>
        /// Template Setup and Receivers: Use ALL REPORTS template and send just one
        /// reminder per facility when number of missing reports exceeds specified limit
        /// </summary>
        MESSAGE_TEMPLATE_ONE_REMINDER_PER_FACILITY = 65536,     // bits: 0001 (16 bits)

        /// <summary>
        /// Factory Settings for Basic Configurations
        /// </summary>
        FACTORY_SETTINGS = MESSAGE_TEMPLATE_SAME_ALL_REPORTS
            | REMINDER_RECEIVERS_ALL_REGISTERED
            | REMINDED_FACILITIES_BY_REGIONS
            | REPETITION_PATTERN_WEEKLY
            | STOPPING_CONDITION_UNTILL_END_OF_MONTH
            | SENDING_EXCEPTION_EXCLUDE_WEEK_ENDS
            | SENDING_EXCEPTION_EXCLUDE_HOLIDAYS
            | SENDING_EXCEPTION_USE_WORKING_HOURS
            | MESSAGE_TEMPLATE_ONE_REMINDER_PER_FACILITY
    }
    #endregion
    #endregion
}
